<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"      
	  xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Insert title here</title>
	</head>
	<body>
	<h:form>
		<h:panelGrid columns="2">
			<h:outputLabel for="title" value="TYTUŁ: *"/>
			<h:inputText id="title" value="#{advertisementRegBean.advertisement.title}"/>
			
			<h:outputLabel for="content" value="TEKST: *"/>
			<h:inputTextarea id="content" value="#{advertisementRegBean.advertisement.content}"/>
			
			<h:outputLabel for="category" value="KATEGORIA: *"/>
			<h:selectOneListbox id="category" value="#{advertisementRegBean.selectedCategory}">
				<f:selectItems value="#{advertisementRegBean.categories}" var="y"
   					itemLabel="#{y.name}" itemValue="#{y.name}"/>
			</h:selectOneListbox>
			
			<h:outputLabel for="type" value="RODZAJ OFERTY: *"/>
			<h:selectOneListbox id="type" value="#{advertisementRegBean.selectedType}">
				<f:selectItems value="#{advertisementRegBean.types}" var="y"
   					itemLabel="#{y.name}" itemValue="#{y.name}"/>
			</h:selectOneListbox>
			
			<h:outputLabel for="startDate" value="DATA ROZPOCZĘCIA: *"/>
			<h:inputText id="startDate" value="#{advertisementRegBean.advertisement.startDate}">
				<f:convertDateTime pattern="dd.MM.yyyy" />
			</h:inputText>
			
			<h:outputLabel for="expireDate" value="DATA ZAKOŃCZENIA: *"/>
			<h:inputText id="expireDate" value="#{advertisementRegBean.advertisement.expireDate}">
				<f:convertDateTime pattern="dd.MM.yyyy" />
			</h:inputText>
			
			<h:outputLabel for="att1" value="ZAŁACZNIK 1: *"/>
			<h:inputText id="att1" value="#{advertisementRegBean.attachment1}"/>
			
			<h:outputLabel for="att2" value="ZAŁACZNIK 2: *"/>
			<h:inputText id="att2" value="#{advertisementRegBean.attachment2}"/>
			
			<h:outputLabel for="att3" value="ZAŁACZNIK 3: *"/>
			<h:inputText id="att3" value="#{advertisementRegBean.attachment3}"/>
			
			<h:outputLabel for="button"/>
			<h:commandButton id="button" value="OK" action="#{advertisementRegBean.trySave()}"/>
			<h:outputText for="result" value="#{advertisementRegBean.regAdvertisementStatus}"/>
		</h:panelGrid>
	</h:form>
	</body>
</html>